local transform;
local gameObject;

LoginPanel = {};
local this = LoginPanel;

function LoginPanel.Start()
    logWarn("Start lua--->>");
end

--启动事件--
function LoginPanel.Awake(obj)
    gameObject = obj;
    transform = obj.transform;

    this.InitPanel();
    logWarn("Awake lua--->>"..gameObject.name);
end

--初始化面板--
function LoginPanel.InitPanel()
    LoginPanel.accountInput = transform:Find("AccountInput").gameObject;
    LoginPanel.passwordInput = transform:Find("PwdInput").gameObject;
    LoginPanel.loginButton = transform:Find("LoginButton").gameObject;
    LoginPanel.savePWdToggle = transform:Find("Toggle").gameObject;

    LoginPanel.TestDotween();
end

--测试Dotween插件是否能正常运行
function LoginPanel.TestDotween()
    local originPos = LoginPanel.loginButton.transform.localPosition;
    local targetPos = Vector3(originPos.x - 100, originPos.y, 0);

    --这段代码有问题,没有进行回调函数
    LoginPanel.loginButton.transform:DOLocalMove(targetPos, 0.5):SetLoops(-1, DG.Tweening.LoopType.Yoyo)
    :OnComplete(function ()
        log("Dotween anim Complete");
    end);
end

--单击事件--
function LoginPanel.OnDestroy()
    logWarn("OnDestroy---->>>");
end